// const BASE_URL = 'http://api/'
function request(url, method, data, header = {}) {
  return new Promise((resolve, reject) => {
    uni.request({
      url: BASE_URL + url,
      method: method,
      data: data,
      header: header,
      success: (res) => {
        resolve(res.data);
      },
      fail: (res) => {
        reject(res);
      }
    });
  });
}
export default request;